package com.zhongge.singlelistOJ;

/**
 * @ClassName TestSingleList
 * @Description TODO 测试单链表
 * @Author 笨忠
 * @Date 2025/8/8 18:29
 * @Version 1.0
 */
public class TestSingleList {
    public static void main(String[] args) {
        SingleLinkedList<Integer> list = new SingleLinkedList<>();
        /*list.createSingleList();
        list.display();*/
        list.addLast(23);
        list.addLast(23);
        list.addLast(100);
        list.addLast(23);
        list.addLast(23);
        System.out.println("=========头插=============");
        list.display();

        /*list.addLast(12);
        list.display();*/

        /*System.out.println("=========中间插=============");*/
     /*   list.addIndex(0, 999);
        list.display();
        list.addIndex(2, 100);
        list.display();
        list.addIndex(6, 200);
        list.display();
        list.addIndex(8, 200);
        list.display();*/

        /*System.out.println(list.contains(56));
        System.out.println(list.contains(100));*/
        /*list.remove(23);
        list.display();
        list.remove(56);
        list.display();
        list.remove(78);
        list.display();*/

        System.out.println("=======删除所有23========");
        list.removeAllKey(23);
        list.display();

        System.out.println("=======清空========");
        list.clear();
        list.display();

        SingleLinkedList<String> list1 = new SingleLinkedList<>();
        list1.addLast("刘备");
        list1.addLast("关羽");
        list1.addLast("张飞");
        list1.display();
    }
}
